<%--
  Created by IntelliJ IDEA.
  User: WHP
  Date: 2020/7/25
  Time: 14:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>仓库管理员注册</title>

    <%--jq--%>
    <script src="${pageContext.request.contextPath}/static/jquery/jquery-3.5.1.js" type="text/javascript"></script>
    <%--    laiui 框架--%>
    <script src="${pageContext.request.contextPath}/static/layui/layui.js" type="text/javascript"
            charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <%--    bootstrap 框架--%>
    <script src="${pageContext.request.contextPath}/static/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.css" type='text/css'>

    <%--    font-awesome 图标库--%>
    <link href="${pageContext.request.contextPath}/front/css/font-awesome.min.css" type="text/css" rel="stylesheet">
    <%--    百度地图API--%>
    <%--    <script type="text/javascript"--%>
    <%--            src="http://api.map.baidu.com/api?v=3.0&ak=lewICX42RZIlfELxB6dG81zz5W1juYc6"></script>--%>
    <%--    高德地图API--%>
    <script type="text/javascript"
            src="https://webapi.amap.com/maps?v=1.4.15&key=5702b4a78aee7e6d4704e647d45a5e5d&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.DistrictSearch,AMap.Geolocation"></script>
    <%--    项目 css--%>
    <link href="${pageContext.request.contextPath}/front/css/style.css" rel="stylesheet" type="text/css"/>
</head>
<body class="layui-bg-green">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
               <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
               <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
               <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
          </ol>
        <div class="carousel-inner">

             <div class="carousel-item active">
                  <img src="${pageContext.request.contextPath}/front/images/banner.jpg" style="height: 30%"
                 class="d-block w-100" alt="...">
             </div>

             <div class="carousel-item">
                 <img src="${pageContext.request.contextPath}/front/images/10170137_889656.jpg" style="height: 30%"
                 class="d-block w-100" alt="...">
             </div>

              <div class="carousel-item">
                  <img src="${pageContext.request.contextPath}/front/images/4875-fyrcsrv8762382.jpg" style="height: 30%"
                 class="d-block w-100" alt="...">
              </div>
        </div>
           <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
               <span class="carousel-control-prev-icon" aria-hidden="true"></span>
               <span class="sr-only">Previous</span>
           </a>
           <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
              <span class="carousel-control-next-icon" aria-hidden="true"></span>
              <span class="sr-only">Next</span>
           </a>
 </div>

<div id="" class="container layui-bg-green">

    <form method="post">

        <div class="form-group">
            <label for="houseManagerName">用户名</label>
            <input type="text" class="form-control col-lg-6 col-md-4" id="houseManagerName" name="houseManagerName"
                   aria-describedby="houseManagerNameHelp">
            <small id="houseManagerNameHelp" class="form-text text-muted">用户名一旦设置,不可更改</small>
        </div>

        <div class="form-group">
            <label for="houseManagerPsw">密码</label>
            <input type="password" class="form-control col-lg-6 col-md-4" id="houseManagerPsw" name="houseManagerPsw"
                   aria-describedby="houseManagerPswdHelp">
            <small id="houseManagerPswHelp" class="form-text text-muted">密码用于登录</small>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">仓号: </label>
            <div class="layui-input-block">
                <input type="text" name="houseId"  id="houseId" placeholder="请输入仓号">
                <%--<select name="houseIdList" id="houseIdList" lay-verify="required">

                </select>--%>
            </div>
        </div>

        <input type="button" class="btn btn-dark" value="注册" id="register">
    </form>
</div>
</body>
<script type="text/javascript">


    $(document).ready(function () {
        //在下拉选择框中显示仓库编号
      /*  getHouseIdList();*/


      $("#register").click(function () {

          var houseManagerName = $("#houseManagerName").val();
          var houseMangerPsw = $("#houseManagerPsw").val();
          var houseId = $("#houseId").val();

          var house = {
              houseId : houseId
          }

          var houseManager = {
              houseManagerName : houseManagerName,
              houseManagerPsw : houseMangerPsw,
              house : house
          }

          console.log("测试："+JSON.stringify(houseManager));

          $.ajax({
              async:false,
              type:"post",
              contentType:"application/json",
              dataType:"json",
              url:"${pageContext.request.contextPath}/houseManagerRegisterController/houseManagerRegiseter",

              data:JSON.stringify(houseManager),

              success:function (result) {
                  // 2.页面跳转到首页
                  location.href = "houseMangerLogin.jsp";
              },
              error:function () {
                  alert("异步请求失败!");
              }
          });

          })
      })




</script>

</html>
